package org.travel.api.travel.pojo;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

@Entity
@Table(name = "flightsorder")
public class Flightsorder implements Serializable {
    private String orderid;
    private String ordernumber;
    /*private Integer userId;*/
    private User user = new User();
    /*private Integer flightsid;*/
    private Flights flights =new Flights();
    private Double flightsPrice;
    private Integer purchase;
    /*private Integer dic;*/
    private Dictionaries dictionaries=new Dictionaries();
    private Date ydTime;
    private Date payDate;


    @Basic
    @Column(name = "orderid", nullable = true, length = 100)
    @Id
    public String getOrderid() {
        return orderid;
    }

    public void setOrderid(String orderid) {
        this.orderid = orderid;
    }

    @Basic
    @Column(name = "ordernumber", nullable = true, length = 200)
    public String getOrdernumber() {
        return ordernumber;
    }

    public void setOrdernumber(String ordernumber) {
        this.ordernumber = ordernumber;
    }

    /*@Basic
    @Column(name = "userId", nullable = true)
    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }*/

   /* @Basic
    @Column(name = "flightsid", nullable = true)
    public Integer getFlightsid() {
        return flightsid;
    }

    public void setFlightsid(Integer flightsid) {
        this.flightsid = flightsid;
    }*/

    @Basic
    @Column(name = "flights_Price", nullable = true, precision = 0)
    public Double getFlightsPrice() {
        return flightsPrice;
    }

    public void setFlightsPrice(Double flightsPrice) {
        this.flightsPrice = flightsPrice;
    }

    @Basic
    @Column(name = "purchase", nullable = true)
    public Integer getPurchase() {
        return purchase;
    }

    public void setPurchase(Integer purchase) {
        this.purchase = purchase;
    }

   /* @Basic
    @Column(name = "dic", nullable = true)
    public Integer getDic() {
        return dic;
    }

    public void setDic(Integer dic) {
        this.dic = dic;
    }*/

    @Basic
    @Column(name = "YDTime", nullable = true)
    public Date getYdTime() {
        return ydTime;
    }

    public void setYdTime(Date ydTime) {
        this.ydTime = ydTime;
    }

    @Basic
    @Column(name = "PayDate", nullable = true)
    public Date getPayDate() {
        return payDate;
    }

    public void setPayDate(Date payDate) {
        this.payDate = payDate;
    }

    @ManyToOne
    @JoinColumn(name = "userId")
    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    @ManyToOne
    @JoinColumn(name = "dicId")
    public Dictionaries getDictionaries() {
        return dictionaries;
    }

    public void setDictionaries(Dictionaries dictionaries) {
        this.dictionaries = dictionaries;
    }

    @ManyToOne
    @JoinColumn(name = "flightsid")
    public Flights getFlights() {
        return flights;
    }

    public void setFlights(Flights flights) {
        this.flights = flights;
    }

    /* @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Flightsorder that = (Flightsorder) o;
        return Objects.equals(orderid, that.orderid) &&
                Objects.equals(ordernumber, that.ordernumber) &&
                Objects.equals(userId, that.userId) &&
                Objects.equals(flightsid, that.flightsid) &&
                Objects.equals(flightsPrice, that.flightsPrice) &&
                Objects.equals(purchase, that.purchase) &&
                Objects.equals(dic, that.dic) &&
                Objects.equals(ydTime, that.ydTime) &&
                Objects.equals(payDate, that.payDate);
    }

    @Override
    public int hashCode() {
        return Objects.hash(orderid, ordernumber, userId, flightsid, flightsPrice, purchase, dic, ydTime, payDate);
    }*/
}
